Left Termination of the query pattern slowsort_in_2(a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

slowsort(X, Y) :- ','(perm(X, Y), sorted(Y)).
sorted([]).
sorted(.(X, [])).
sorted(.(X, .(Y, Z))) :- ','(le(X, Y), sorted(.(Y, Z))).
perm([], []).
perm(.(X, .(Y, [])), .(U, .(V, []))) :- ','(delete(U, .(X, Y), Z), perm(Z, V)).
delete(X, .(X, Y), Y).
delete(X, .(Y, Z), W) :- delete(X, Z, W).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(X)).
le(0, 0).

Queries:

slowsort(a,g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
slowsort_in: (f,b)
perm_in: (f,b) (f,f)
delete_in: (f,b,f) (f,f,f)
sorted_in: (b)
le_in: (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SLOWSORT_IN_AG(X, Y) → U1_AG(X, Y, perm_in_ag(X, Y))
SLOWSORT_IN_AG(X, Y) → PERM_IN_AG(X, Y)
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → U5_AG(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
DELETE_IN_AGA(X, .(Y, Z), W) → U7_AGA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AGA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
DELETE_IN_AAA(X, .(Y, Z), W) → U7_AAA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AG(X, Y, U, V, perm_in_aa(Z, V))
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AA(X, Y, U, V, perm_in_aa(Z, V))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
U1_AG(X, Y, perm_out_ag(X, Y)) → U2_AG(X, Y, sorted_in_g(Y))
U1_AG(X, Y, perm_out_ag(X, Y)) → SORTED_IN_G(Y)
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))
SORTED_IN_G(.(X, .(Y, Z))) → LE_IN_AA(X, Y)
LE_IN_AA(s(X), s(Y)) → U8_AA(X, Y, le_in_aa(X, Y))
LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)
U3_G(X, Y, Z, le_out_aa(X, Y)) → U4_G(X, Y, Z, sorted_in_g(.(Y, Z)))
U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA
U7_AAA(x1, x2, x3, x4, x5)  =  U7_AAA(x5)
PERM_IN_AG(x1, x2)  =  PERM_IN_AG(x2)
U2_AG(x1, x2, x3)  =  U2_AG(x1, x3)
U5_AG(x1, x2, x3, x4, x5)  =  U5_AG(x5)
U6_AG(x1, x2, x3, x4, x5)  =  U6_AG(x5)
LE_IN_AA(x1, x2)  =  LE_IN_AA
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)
U7_AGA(x1, x2, x3, x4, x5)  =  U7_AGA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
U6_AA(x1, x2, x3, x4, x5)  =  U6_AA(x5)
DELETE_IN_AGA(x1, x2, x3)  =  DELETE_IN_AGA(x2)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
SLOWSORT_IN_AG(x1, x2)  =  SLOWSORT_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SLOWSORT_IN_AG(X, Y) → U1_AG(X, Y, perm_in_ag(X, Y))
SLOWSORT_IN_AG(X, Y) → PERM_IN_AG(X, Y)
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → U5_AG(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
DELETE_IN_AGA(X, .(Y, Z), W) → U7_AGA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AGA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
DELETE_IN_AAA(X, .(Y, Z), W) → U7_AAA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AG(X, Y, U, V, perm_in_aa(Z, V))
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AA(X, Y, U, V, perm_in_aa(Z, V))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
U1_AG(X, Y, perm_out_ag(X, Y)) → U2_AG(X, Y, sorted_in_g(Y))
U1_AG(X, Y, perm_out_ag(X, Y)) → SORTED_IN_G(Y)
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))
SORTED_IN_G(.(X, .(Y, Z))) → LE_IN_AA(X, Y)
LE_IN_AA(s(X), s(Y)) → U8_AA(X, Y, le_in_aa(X, Y))
LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)
U3_G(X, Y, Z, le_out_aa(X, Y)) → U4_G(X, Y, Z, sorted_in_g(.(Y, Z)))
U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA
U7_AAA(x1, x2, x3, x4, x5)  =  U7_AAA(x5)
PERM_IN_AG(x1, x2)  =  PERM_IN_AG(x2)
U2_AG(x1, x2, x3)  =  U2_AG(x1, x3)
U5_AG(x1, x2, x3, x4, x5)  =  U5_AG(x5)
U6_AG(x1, x2, x3, x4, x5)  =  U6_AG(x5)
LE_IN_AA(x1, x2)  =  LE_IN_AA
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)
U7_AGA(x1, x2, x3, x4, x5)  =  U7_AGA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
U6_AA(x1, x2, x3, x4, x5)  =  U6_AA(x5)
DELETE_IN_AGA(x1, x2, x3)  =  DELETE_IN_AGA(x2)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
SLOWSORT_IN_AG(x1, x2)  =  SLOWSORT_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 16 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
LE_IN_AA(x1, x2)  =  LE_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
LE_IN_AA(x1, x2)  =  LE_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LE_IN_AALE_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

LE_IN_AALE_IN_AA

The TRS R consists of the following rules:none


s = LE_IN_AA evaluates to t =LE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from LE_IN_AA to LE_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))

The TRS R consists of the following rules:

le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_in_aa)
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)

The set Q consists of the following terms:

le_in_aa
U8_aa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule SORTED_IN_G(.) → U3_G(le_in_aa) at position [0] we obtained the following new rules:

SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))
SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)
SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)

The set Q consists of the following terms:

le_in_aa
U8_aa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)
SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)


s = U3_G(le_out_aa(X, Y)) evaluates to t =U3_G(le_out_aa(0, s))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U3_G(le_out_aa(X, Y))SORTED_IN_G(.)
with rule U3_G(le_out_aa(X', Y')) → SORTED_IN_G(.) at position [] and matcher [Y' / Y, X' / X]

SORTED_IN_G(.)U3_G(le_out_aa(0, s))
with rule SORTED_IN_G(.) → U3_G(le_out_aa(0, s))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAADELETE_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

DELETE_IN_AAADELETE_IN_AAA

The TRS R consists of the following rules:none


s = DELETE_IN_AAA evaluates to t =DELETE_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from DELETE_IN_AAA to DELETE_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)

The TRS R consists of the following rules:

delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN_AAU5_AA(delete_in_aga(.))
U5_AA(delete_out_aga) → PERM_IN_AA

The TRS R consists of the following rules:

delete_in_aga(.) → delete_out_aga
delete_in_aga(.) → U7_aga(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga
delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_IN_AAU5_AA(delete_in_aga(.)) at position [0] we obtained the following new rules:

PERM_IN_AAU5_AA(delete_out_aga)
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
U5_AA(delete_out_aga) → PERM_IN_AA
PERM_IN_AAU5_AA(delete_out_aga)

The TRS R consists of the following rules:

delete_in_aga(.) → delete_out_aga
delete_in_aga(.) → U7_aga(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga
delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
U5_AA(delete_out_aga) → PERM_IN_AA
PERM_IN_AAU5_AA(delete_out_aga)

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

delete_in_aga(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
U5_AA(delete_out_aga) → PERM_IN_AA
PERM_IN_AAU5_AA(delete_out_aga)

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
U5_AA(delete_out_aga) → PERM_IN_AA
PERM_IN_AAU5_AA(delete_out_aga)

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)


s = PERM_IN_AA evaluates to t =PERM_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

PERM_IN_AAU5_AA(delete_out_aga)
with rule PERM_IN_AAU5_AA(delete_out_aga) at position [] and matcher [ ]

U5_AA(delete_out_aga)PERM_IN_AA
with rule U5_AA(delete_out_aga) → PERM_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
slowsort_in: (f,b)
perm_in: (f,b) (f,f)
delete_in: (f,b,f) (f,f,f)
sorted_in: (b)
le_in: (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

SLOWSORT_IN_AG(X, Y) → U1_AG(X, Y, perm_in_ag(X, Y))
SLOWSORT_IN_AG(X, Y) → PERM_IN_AG(X, Y)
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → U5_AG(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
DELETE_IN_AGA(X, .(Y, Z), W) → U7_AGA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AGA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
DELETE_IN_AAA(X, .(Y, Z), W) → U7_AAA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AG(X, Y, U, V, perm_in_aa(Z, V))
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AA(X, Y, U, V, perm_in_aa(Z, V))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
U1_AG(X, Y, perm_out_ag(X, Y)) → U2_AG(X, Y, sorted_in_g(Y))
U1_AG(X, Y, perm_out_ag(X, Y)) → SORTED_IN_G(Y)
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))
SORTED_IN_G(.(X, .(Y, Z))) → LE_IN_AA(X, Y)
LE_IN_AA(s(X), s(Y)) → U8_AA(X, Y, le_in_aa(X, Y))
LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)
U3_G(X, Y, Z, le_out_aa(X, Y)) → U4_G(X, Y, Z, sorted_in_g(.(Y, Z)))
U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA
U7_AAA(x1, x2, x3, x4, x5)  =  U7_AAA(x5)
PERM_IN_AG(x1, x2)  =  PERM_IN_AG(x2)
U2_AG(x1, x2, x3)  =  U2_AG(x1, x2, x3)
U5_AG(x1, x2, x3, x4, x5)  =  U5_AG(x5)
U6_AG(x1, x2, x3, x4, x5)  =  U6_AG(x5)
LE_IN_AA(x1, x2)  =  LE_IN_AA
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)
U7_AGA(x1, x2, x3, x4, x5)  =  U7_AGA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
U6_AA(x1, x2, x3, x4, x5)  =  U6_AA(x5)
DELETE_IN_AGA(x1, x2, x3)  =  DELETE_IN_AGA(x2)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
SLOWSORT_IN_AG(x1, x2)  =  SLOWSORT_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

SLOWSORT_IN_AG(X, Y) → U1_AG(X, Y, perm_in_ag(X, Y))
SLOWSORT_IN_AG(X, Y) → PERM_IN_AG(X, Y)
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → U5_AG(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AG(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
DELETE_IN_AGA(X, .(Y, Z), W) → U7_AGA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AGA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
DELETE_IN_AAA(X, .(Y, Z), W) → U7_AAA(X, Y, Z, W, delete_in_aaa(X, Z, W))
DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AG(X, Y, U, V, perm_in_aa(Z, V))
U5_AG(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → DELETE_IN_AGA(U, .(X, Y), Z)
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_AA(X, Y, U, V, perm_in_aa(Z, V))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)
U1_AG(X, Y, perm_out_ag(X, Y)) → U2_AG(X, Y, sorted_in_g(Y))
U1_AG(X, Y, perm_out_ag(X, Y)) → SORTED_IN_G(Y)
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))
SORTED_IN_G(.(X, .(Y, Z))) → LE_IN_AA(X, Y)
LE_IN_AA(s(X), s(Y)) → U8_AA(X, Y, le_in_aa(X, Y))
LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)
U3_G(X, Y, Z, le_out_aa(X, Y)) → U4_G(X, Y, Z, sorted_in_g(.(Y, Z)))
U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA
U7_AAA(x1, x2, x3, x4, x5)  =  U7_AAA(x5)
PERM_IN_AG(x1, x2)  =  PERM_IN_AG(x2)
U2_AG(x1, x2, x3)  =  U2_AG(x1, x2, x3)
U5_AG(x1, x2, x3, x4, x5)  =  U5_AG(x5)
U6_AG(x1, x2, x3, x4, x5)  =  U6_AG(x5)
LE_IN_AA(x1, x2)  =  LE_IN_AA
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)
U7_AGA(x1, x2, x3, x4, x5)  =  U7_AGA(x5)
U8_AA(x1, x2, x3)  =  U8_AA(x3)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
U6_AA(x1, x2, x3, x4, x5)  =  U6_AA(x5)
DELETE_IN_AGA(x1, x2, x3)  =  DELETE_IN_AGA(x2)
U4_G(x1, x2, x3, x4)  =  U4_G(x4)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
SLOWSORT_IN_AG(x1, x2)  =  SLOWSORT_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 16 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
LE_IN_AA(x1, x2)  =  LE_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_AA(s(X), s(Y)) → LE_IN_AA(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
LE_IN_AA(x1, x2)  =  LE_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LE_IN_AALE_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

LE_IN_AALE_IN_AA

The TRS R consists of the following rules:none


s = LE_IN_AA evaluates to t =LE_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from LE_IN_AA to LE_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U3_G(X, Y, Z, le_out_aa(X, Y)) → SORTED_IN_G(.(Y, Z))
SORTED_IN_G(.(X, .(Y, Z))) → U3_G(X, Y, Z, le_in_aa(X, Y))

The TRS R consists of the following rules:

le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U3_G(x1, x2, x3, x4)  =  U3_G(x4)
SORTED_IN_G(x1)  =  SORTED_IN_G(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_in_aa)
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)

The set Q consists of the following terms:

le_in_aa
U8_aa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule SORTED_IN_G(.) → U3_G(le_in_aa) at position [0] we obtained the following new rules:

SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))
SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)
SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)

The set Q consists of the following terms:

le_in_aa
U8_aa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

SORTED_IN_G(.) → U3_G(le_out_aa(0, s))
SORTED_IN_G(.) → U3_G(le_out_aa(0, 0))
U3_G(le_out_aa(X, Y)) → SORTED_IN_G(.)
SORTED_IN_G(.) → U3_G(U8_aa(le_in_aa))

The TRS R consists of the following rules:

le_in_aaU8_aa(le_in_aa)
le_in_aale_out_aa(0, s)
le_in_aale_out_aa(0, 0)
U8_aa(le_out_aa(X, Y)) → le_out_aa(s, s)


s = U3_G(le_out_aa(X, Y)) evaluates to t =U3_G(le_out_aa(0, s))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U3_G(le_out_aa(X, Y))SORTED_IN_G(.)
with rule U3_G(le_out_aa(X', Y')) → SORTED_IN_G(.) at position [] and matcher [Y' / Y, X' / X]

SORTED_IN_G(.)U3_G(le_out_aa(0, s))
with rule SORTED_IN_G(.) → U3_G(le_out_aa(0, s))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAA(X, .(Y, Z), W) → DELETE_IN_AAA(X, Z, W)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .
DELETE_IN_AAA(x1, x2, x3)  =  DELETE_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

DELETE_IN_AAADELETE_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

DELETE_IN_AAADELETE_IN_AAA

The TRS R consists of the following rules:none


s = DELETE_IN_AAA evaluates to t =DELETE_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from DELETE_IN_AAA to DELETE_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)

The TRS R consists of the following rules:

slowsort_in_ag(X, Y) → U1_ag(X, Y, perm_in_ag(X, Y))
perm_in_ag([], []) → perm_out_ag([], [])
perm_in_ag(.(X, .(Y, [])), .(U, .(V, []))) → U5_ag(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
U5_ag(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_ag(X, Y, U, V, perm_in_aa(Z, V))
perm_in_aa([], []) → perm_out_aa([], [])
perm_in_aa(.(X, .(Y, [])), .(U, .(V, []))) → U5_aa(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_aa(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → U6_aa(X, Y, U, V, perm_in_aa(Z, V))
U6_aa(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_aa(.(X, .(Y, [])), .(U, .(V, [])))
U6_ag(X, Y, U, V, perm_out_aa(Z, V)) → perm_out_ag(.(X, .(Y, [])), .(U, .(V, [])))
U1_ag(X, Y, perm_out_ag(X, Y)) → U2_ag(X, Y, sorted_in_g(Y))
sorted_in_g([]) → sorted_out_g([])
sorted_in_g(.(X, [])) → sorted_out_g(.(X, []))
sorted_in_g(.(X, .(Y, Z))) → U3_g(X, Y, Z, le_in_aa(X, Y))
le_in_aa(s(X), s(Y)) → U8_aa(X, Y, le_in_aa(X, Y))
le_in_aa(0, s(X)) → le_out_aa(0, s(X))
le_in_aa(0, 0) → le_out_aa(0, 0)
U8_aa(X, Y, le_out_aa(X, Y)) → le_out_aa(s(X), s(Y))
U3_g(X, Y, Z, le_out_aa(X, Y)) → U4_g(X, Y, Z, sorted_in_g(.(Y, Z)))
U4_g(X, Y, Z, sorted_out_g(.(Y, Z))) → sorted_out_g(.(X, .(Y, Z)))
U2_ag(X, Y, sorted_out_g(Y)) → slowsort_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
slowsort_in_ag(x1, x2)  =  slowsort_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
perm_in_ag(x1, x2)  =  perm_in_ag(x2)
[]  =  []
perm_out_ag(x1, x2)  =  perm_out_ag(x1, x2)
.(x1, x2)  =  .
U5_ag(x1, x2, x3, x4, x5)  =  U5_ag(x5)
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U6_ag(x1, x2, x3, x4, x5)  =  U6_ag(x5)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U5_aa(x1, x2, x3, x4, x5)  =  U5_aa(x5)
U6_aa(x1, x2, x3, x4, x5)  =  U6_aa(x5)
U2_ag(x1, x2, x3)  =  U2_ag(x1, x2, x3)
sorted_in_g(x1)  =  sorted_in_g(x1)
sorted_out_g(x1)  =  sorted_out_g(x1)
U3_g(x1, x2, x3, x4)  =  U3_g(x4)
le_in_aa(x1, x2)  =  le_in_aa
U8_aa(x1, x2, x3)  =  U8_aa(x3)
le_out_aa(x1, x2)  =  le_out_aa(x1, x2)
s(x1)  =  s
U4_g(x1, x2, x3, x4)  =  U4_g(x4)
slowsort_out_ag(x1, x2)  =  slowsort_out_ag(x1, x2)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_AA(.(X, .(Y, [])), .(U, .(V, []))) → U5_AA(X, Y, U, V, delete_in_aga(U, .(X, Y), Z))
U5_AA(X, Y, U, V, delete_out_aga(U, .(X, Y), Z)) → PERM_IN_AA(Z, V)

The TRS R consists of the following rules:

delete_in_aga(X, .(X, Y), Y) → delete_out_aga(X, .(X, Y), Y)
delete_in_aga(X, .(Y, Z), W) → U7_aga(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aga(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aga(X, .(Y, Z), W)
delete_in_aaa(X, .(X, Y), Y) → delete_out_aaa(X, .(X, Y), Y)
delete_in_aaa(X, .(Y, Z), W) → U7_aaa(X, Y, Z, W, delete_in_aaa(X, Z, W))
U7_aaa(X, Y, Z, W, delete_out_aaa(X, Z, W)) → delete_out_aaa(X, .(Y, Z), W)

The argument filtering Pi contains the following mapping:
[]  =  []
.(x1, x2)  =  .
delete_in_aga(x1, x2, x3)  =  delete_in_aga(x2)
delete_out_aga(x1, x2, x3)  =  delete_out_aga(x2)
U7_aga(x1, x2, x3, x4, x5)  =  U7_aga(x5)
delete_in_aaa(x1, x2, x3)  =  delete_in_aaa
delete_out_aaa(x1, x2, x3)  =  delete_out_aaa(x2)
U7_aaa(x1, x2, x3, x4, x5)  =  U7_aaa(x5)
U5_AA(x1, x2, x3, x4, x5)  =  U5_AA(x5)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U5_AA(delete_out_aga(.)) → PERM_IN_AA
PERM_IN_AAU5_AA(delete_in_aga(.))

The TRS R consists of the following rules:

delete_in_aga(.) → delete_out_aga(.)
delete_in_aga(.) → U7_aga(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga(.)
delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_IN_AAU5_AA(delete_in_aga(.)) at position [0] we obtained the following new rules:

PERM_IN_AAU5_AA(delete_out_aga(.))
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

U5_AA(delete_out_aga(.)) → PERM_IN_AA
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
PERM_IN_AAU5_AA(delete_out_aga(.))

The TRS R consists of the following rules:

delete_in_aga(.) → delete_out_aga(.)
delete_in_aga(.) → U7_aga(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga(.)
delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

U5_AA(delete_out_aga(.)) → PERM_IN_AA
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
PERM_IN_AAU5_AA(delete_out_aga(.))

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga(.)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

delete_in_aga(x0)
U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

delete_in_aga(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

U5_AA(delete_out_aga(.)) → PERM_IN_AA
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
PERM_IN_AAU5_AA(delete_out_aga(.))

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga(.)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)

The set Q consists of the following terms:

U7_aga(x0)
delete_in_aaa
U7_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U5_AA(delete_out_aga(.)) → PERM_IN_AA
PERM_IN_AAU5_AA(U7_aga(delete_in_aaa))
PERM_IN_AAU5_AA(delete_out_aga(.))

The TRS R consists of the following rules:

delete_in_aaadelete_out_aaa(.)
delete_in_aaaU7_aaa(delete_in_aaa)
U7_aga(delete_out_aaa(Z)) → delete_out_aga(.)
U7_aaa(delete_out_aaa(Z)) → delete_out_aaa(.)


s = PERM_IN_AA evaluates to t =PERM_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

PERM_IN_AAU5_AA(delete_out_aga(.))
with rule PERM_IN_AAU5_AA(delete_out_aga(.)) at position [] and matcher [ ]

U5_AA(delete_out_aga(.))PERM_IN_AA
with rule U5_AA(delete_out_aga(.)) → PERM_IN_AA

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.